#include <stdio.h>

double findMaxAverage(int* nums, int numsSize, int k)
{
    double max = 0;
    for(int i = 0;i < numsSize - k + 1 ;i++)
    {
        int count = 0;
        for(int j = 0;j < k;j++)
        {
            count += nums[i + j];
        }
        max = max > count ? max : count;
    }
    return max / k;
    
}

int main()
{
    int nums[] = {1,12,-5,-6,50,3};
    int numsSize = sizeof(nums)/sizeof(nums[0]);
    int k = 4;
    double n = findMaxAverage(nums,numsSize, k);
    printf("%.2f\n",n);
    return 0;
}